home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch17 / pi / scalcyl / scalcyl.pi < prev   
Encoding:
Text File  |  1994-08-03  |  776 b   |  40 lines

  1. // Polyray scene file:  SCALCYL.PI
  2. // Author:  Rob McGregor
  3.  
  4. // A cylinder changes scale on the y-axis
  5.  
  6. include "..\..\..\colors.inc"
  7. include "..\..\..\texture.inc"
  8.  
  9. // Lights and background color
  10. light <-5, 2, -15>
  11. light <5, 2, -15>
  12. background grey
  13.  
  14. // Set up the camera
  15. viewpoint {
  16.   from       <0, 0, -3>
  17.   at         <0, 0, 0>
  18.   up         <0, 1, 0>
  19.   angle      45
  20.   resolution 320, 200
  21.   aspect     1.6
  22. }
  23.  
  24. // Define the range of animation
  25. start_frame  0
  26. end_frame    49
  27. total_frames 50
  28. outfile      "scale"
  29.  
  30. // Calculate the changing scale
  31. static define height 2.0
  32. define change (height/total_frames) * frame
  33.  
  34. // Create the cylinder
  35. object {
  36.   cylinder <0, -0.5, 0>, <0, 0.5, 0>, 0.25
  37.   scale <1, height - change, 1>
  38.   shiny_red
  39. }
  40.